package com.common.jump;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.curry.android.util.IntentHelper;
import com.orangelife.mobile.goodsOrder.activity.GoodOrdersDetailActivity;
import com.orangelife.mobile.goodsOrder.biz.OrderBiz;
import com.orangelife.mobile.surrounding.activity.SelectedStandardActivity;

import java.io.Serializable;
import java.util.Map;

/**
 * <p>
 * Created by 吴格非 on 2016-11-2.
 * <p>
 *
 * @author 吴格非
 * @since v4.1.0
 */

public class OrderJumper {

    /** 商品订单详情 */
    public static void jumpToGoodOrderDetail(Activity activity, String orderID, String orderType) {
        Intent intent = new Intent();
        intent.putExtra("orderID", orderID);
        intent.putExtra("orderType", orderType);
        intent.setClass(activity, GoodOrdersDetailActivity.class);
        activity.startActivityForResult(intent, OrderBiz.CANCEL_JUMP);
        IntentHelper.getInstances().jumpActivityAnimation(activity, false);
    }

    /** 选择商品规格 */
    public static void jumpToSelectStandard(Activity activity, int reqCode, int position, int limiteNum, int status, Map<String, Object> mapDetail) {
        Intent intent = new Intent();
        Bundle bundle = new Bundle();
        intent.putExtra("position", position);
        intent.putExtra("flag", 1);
        intent.putExtra("isTehui", true);//是否是特惠
        intent.putExtra("limiteNum", limiteNum);//限购数量
        intent.putExtra("tehuiStatus", status);//当前活动的状态
        bundle.putSerializable("specification",
                (Serializable) mapDetail);
        intent.putExtras(bundle);
        intent.setClass(activity,
                SelectedStandardActivity.class);
        activity.startActivityForResult(intent, reqCode);
        IntentHelper.getInstances().jumpActivityAnimation(activity, false);
    }

}
